<!DOCTYPE html>
<!-- saved from url=(0048)https://www.cnblogs.com/yg_zhang/p/10736442.html -->
<html lang="zh-cn"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="referrer" content="origin-when-crossorigin">
    <meta name="description" content="mybatis plus 是基于mybatis 的一个增强包，比 mybatis 更加容易使用。 特点: 1.分页支持 2.支持自定义查询。 3.简单的情况下，不需要写map.xml 文件 4.支持租">
    <meta property="og:description" content="mybatis plus 是基于mybatis 的一个增强包，比 mybatis 更加容易使用。 特点: 1.分页支持 2.支持自定义查询。 3.简单的情况下，不需要写map.xml 文件 4.支持租">
    <meta http-equiv="Cache-Control" content="no-transform">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>使用mybatis plus 操作数据库 - 自由港 - 博客园</title>
    <link id="favicon" rel="shortcut icon" href="https://common.cnblogs.com/favicon.svg" type="image/svg+xml">
    
    <style>:not(.cnblogs_code):not(.cnblogs_Highlighter)>pre:not([class*="language-"]):not([highlighted]):not(.hljs) {
        background: rgb(245, 245, 245);
        padding: 5px;
        border: 1.11111px solid rgb(204, 204, 204);
        border-radius: 3px;
        border-color: transparent;
        color: rgb(68, 68, 68);
        font-family: "Courier New", sans-serif;
    }:not(.cnblogs_code):not(.cnblogs_Highlighter)>pre:not([highlighted]) code:not(.hljs) {
            background: rgb(245, 245, 245) !important;
            border-color: transparent !important;
        }</style><link rel="stylesheet" href="./使用mybatis plus 操作数据库_files/blog-common.min.css">
    <link id="MainCss" rel="stylesheet" href="./使用mybatis plus 操作数据库_files/bundle-nature.min.css">
    <link id="highlighter-theme-cnblogs" type="text/css" rel="stylesheet" href="./使用mybatis plus 操作数据库_files/cnblogs.css">
    
    <link id="mobile-style" media="only screen and (max-width: 767px)" type="text/css" rel="stylesheet" href="./使用mybatis plus 操作数据库_files/bundle-nature-mobile.min.css">
    
    <link type="application/rss+xml" rel="alternate" href="https://www.cnblogs.com/yg_zhang/rss">
    <link type="application/rsd+xml" rel="EditURI" href="https://www.cnblogs.com/yg_zhang/rsd.xml">
    <link type="application/wlwmanifest+xml" rel="wlwmanifest" href="https://www.cnblogs.com/yg_zhang/wlwmanifest.xml">
    <script type="text/javascript" async="" src="./使用mybatis plus 操作数据库_files/analytics.js.下载"></script><script type="text/javascript" src="./使用mybatis plus 操作数据库_files/encoder.js.下载"></script><script>
        var currentBlogId = 11281;
        var currentBlogApp = 'yg_zhang';
        var cb_enable_mathjax = false;
        var isLogined = false;
        var isBlogOwner = false;
        var skinName = 'nature';
        var visitorUserId = '';
        var hasCustomScript = false;
        try {
            if (hasCustomScript && document.referrer && document.referrer.indexOf('baidu.com') >= 0) {
                Object.defineProperty(document, 'referrer', { value: '' });
                Object.defineProperty(Document.prototype, 'referrer', { get: function(){ return ''; } });
            }
        } catch(error) { }
        window.codeHighlightEngine = 1;
        window.enableCodeLineNumber = false;
        window.codeHighlightTheme = 'cnblogs';
    </script>
        <script>
            var currentPostDateAdded = '2019-04-19 15:55';
        </script>
    <script src="./使用mybatis plus 操作数据库_files/jquery-2.2.0.min.js.下载"></script>
    <script src="./使用mybatis plus 操作数据库_files/blog-common.min.js.下载"></script><style type="text/css">.medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}</style><script id="hljs-script" async="" data-loaded="true" src="./使用mybatis plus 操作数据库_files/highlight.min.js.下载"></script>
    
    
    
<meta http-equiv="origin-trial" content="AxujKG9INjsZ8/gUq8+dTruNvk7RjZQ1oFhhgQbcTJKDnZfbzSTE81wvC2Hzaf3TW4avA76LTZEMdiedF1vIbA4AAABueyJvcmlnaW4iOiJodHRwczovL2ltYXNkay5nb29nbGVhcGlzLmNvbTo0NDMiLCJmZWF0dXJlIjoiVHJ1c3RUb2tlbnMiLCJleHBpcnkiOjE2NTI3NzQ0MDAsImlzVGhpcmRQYXJ0eSI6dHJ1ZX0="><meta http-equiv="origin-trial" content="Azuce85ORtSnWe1MZDTv68qpaW3iHyfL9YbLRy0cwcCZwVnePnOmkUJlG8HGikmOwhZU22dElCcfrfX2HhrBPAkAAAB7eyJvcmlnaW4iOiJodHRwczovL2RvdWJsZWNsaWNrLm5ldDo0NDMiLCJmZWF0dXJlIjoiVHJ1c3RUb2tlbnMiLCJleHBpcnkiOjE2NTI3NzQ0MDAsImlzU3ViZG9tYWluIjp0cnVlLCJpc1RoaXJkUGFydHkiOnRydWV9"><meta http-equiv="origin-trial" content="A16nvcdeoOAqrJcmjLRpl1I6f3McDD8EfofAYTt/P/H4/AWwB99nxiPp6kA0fXoiZav908Z8etuL16laFPUdfQsAAACBeyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXRhZ3NlcnZpY2VzLmNvbTo0NDMiLCJmZWF0dXJlIjoiVHJ1c3RUb2tlbnMiLCJleHBpcnkiOjE2NTI3NzQ0MDAsImlzU3ViZG9tYWluIjp0cnVlLCJpc1RoaXJkUGFydHkiOnRydWV9"><meta http-equiv="origin-trial" content="AxBHdr0J44vFBQtZUqX9sjiqf5yWZ/OcHRcRMN3H9TH+t90V/j3ENW6C8+igBZFXMJ7G3Pr8Dd13632aLng42wgAAACBeyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXN5bmRpY2F0aW9uLmNvbTo0NDMiLCJmZWF0dXJlIjoiVHJ1c3RUb2tlbnMiLCJleHBpcnkiOjE2NTI3NzQ0MDAsImlzU3ViZG9tYWluIjp0cnVlLCJpc1RoaXJkUGFydHkiOnRydWV9"><meta http-equiv="origin-trial" content="A88BWHFjcawUfKU3lIejLoryXoyjooBXLgWmGh+hNcqMK44cugvsI5YZbNarYvi3roc1fYbHA1AVbhAtuHZflgEAAAB2eyJvcmlnaW4iOiJodHRwczovL2dvb2dsZS5jb206NDQzIiwiZmVhdHVyZSI6IlRydXN0VG9rZW5zIiwiZXhwaXJ5IjoxNjUyNzc0NDAwLCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ=="><meta http-equiv="origin-trial" content="A8FHS1NmdCwGqD9DwOicnHHY+y27kdWfxKa0YHSGDfv0CSpDKRHTQdQmZVPDUdaFWUsxdgVxlwAd6o+dhJykPA0AAACWeyJvcmlnaW4iOiJodHRwczovL2RvdWJsZWNsaWNrLm5ldDo0NDMiLCJmZWF0dXJlIjoiQ29udmVyc2lvbk1lYXN1cmVtZW50IiwiZXhwaXJ5IjoxNjQzMTU1MTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlLCJ1c2FnZSI6InN1YnNldCJ9"><meta http-equiv="origin-trial" content="A8zdXi6dr1hwXEUjQrYiyYQGlU3557y5QWDnN0Lwgj9ePt66XMEvNkVWOEOWPd7TP9sBQ25X0Q15Lr1Nn4oGFQkAAACceyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXN5bmRpY2F0aW9uLmNvbTo0NDMiLCJmZWF0dXJlIjoiQ29udmVyc2lvbk1lYXN1cmVtZW50IiwiZXhwaXJ5IjoxNjQzMTU1MTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlLCJ1c2FnZSI6InN1YnNldCJ9"><meta http-equiv="origin-trial" content="A4/Htern2udN9w3yJK9QgWQxQFruxOXsXL7cW60DyCl0EZFGCSme/J33Q/WzF7bBkVvhEWDlcBiUyZaim5CpFQwAAACceyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXRhZ3NlcnZpY2VzLmNvbTo0NDMiLCJmZWF0dXJlIjoiQ29udmVyc2lvbk1lYXN1cmVtZW50IiwiZXhwaXJ5IjoxNjQzMTU1MTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlLCJ1c2FnZSI6InN1YnNldCJ9"><script src="./使用mybatis plus 操作数据库_files/pubads_impl_2022030301.js.下载" async=""></script><link rel="preload" href="./使用mybatis plus 操作数据库_files/f.txt" as="script"><script type="text/javascript" src="./使用mybatis plus 操作数据库_files/f.txt"></script></head>
<body class="skin-nature has-navbar">
    <a name="top"></a>
    <div id="top_nav" class="navbar forpc">
        <nav id="nav_main" class="navbar-main">
            <ul id="nav_left" class="navbar-list navbar-left">
                <li class="navbar-branding">
                    <a href="https://www.cnblogs.com/" title="开发者的网上家园" role="banner">
                            <img src="./使用mybatis plus 操作数据库_files/logo.svg" alt="博客园Logo">
                    </a>
                </li>
                <li><a href="https://www.cnblogs.com/" onclick="countClicks(&#39;skin-navbar-sitehome&#39;)">首页</a></li>
                <li><a href="https://news.cnblogs.com/" onclick="countClicks(&#39;nav&#39;, &#39;skin-navbar-news&#39;)">新闻</a></li>
                <li><a href="https://q.cnblogs.com/" onclick="countClicks(&#39;nav&#39;, &#39;skin-navbar-q&#39;)">博问</a></li>
                <li><a id="nav_brandzone" href="https://brands.cnblogs.com/huawei" onclick="countClicks(&#39;nav&#39;, &#39;skin-navbar-brands&#39;)">专区</a></li>
                <li><a href="https://ing.cnblogs.com/" onclick="countClicks(&#39;nav&#39;, &#39;skin-navbar-ing&#39;)">闪存</a></li>
                <li><a href="https://edu.cnblogs.com/" onclick="countClicks(&#39;nav&#39;, &#39;skin-navbar-edu&#39;)">班级</a></li>
            </ul>
            <ul id="nav_right" class="navbar-list navbar-right">
                <li>
                    <form id="zzk_search" class="navbar-search" action="https://zzk.cnblogs.com/s" method="get" role="search">
                        <input name="w" id="zzk_search_input" placeholder="代码改变世界" type="search" tabindex="3">
                        <button type="submit" id="zzk_search_button">
                            <img src="./使用mybatis plus 操作数据库_files/search.svg" alt="搜索">
                        </button>
                    </form>
                </li>
                <li id="navbar_login_status" class="navbar-list">
                    <a class="navbar-user-info navbar-blog" href="https://i.cnblogs.com/EditPosts.aspx?opt=1" alt="写随笔" title="写随笔" style="display: none;">
                        <img id="new_post_icon" class="navbar-icon" src="./使用mybatis plus 操作数据库_files/newpost.svg" alt="写随笔">
                    </a>
                    <a id="navblog-myblog-icon" class="navbar-user-info navbar-blog" href="https://passport.cnblogs.com/GetBlogApplyStatus.aspx" alt="我的博客" title="我的博客" style="display: none;">
                        <img id="myblog_icon" class="navbar-icon" src="./使用mybatis plus 操作数据库_files/myblog.svg" alt="我的博客">
                    </a>
                    <a class="navbar-user-info navbar-message navbar-icon-wrapper" href="https://msg.cnblogs.com/" alt="短消息" title="短消息" style="display: none;">
                        <img id="msg_icon" class="navbar-icon" src="./使用mybatis plus 操作数据库_files/message.svg" alt="短消息">
                        <span id="msg_count" style="display: none"></span>
                    </a>
                    <a id="navbar_lite_mode_indicator" data-current-page="blog" style="display: none" href="javascript:void(0)" alt="简洁模式" title="简洁模式启用，您在访问他人博客时会使用简洁款皮肤展示">
                        <img class="navbar-icon" src="./使用mybatis plus 操作数据库_files/lite-mode-on.svg" alt="简洁模式">
                    </a>
                    <div id="user_info" class="navbar-user-info dropdown" style="display: none;">
                        <a class="dropdown-button" href="https://home.cnblogs.com/">
                            <img id="user_icon" class="navbar-avatar" src="./使用mybatis plus 操作数据库_files/avatar-default.svg" alt="用户头像">
                        </a>
                        <div class="dropdown-menu">
                            <a id="navblog-myblog-text" href="https://passport.cnblogs.com/GetBlogApplyStatus.aspx">我的博客</a>
                            <a href="https://home.cnblogs.com/">我的园子</a>
                            <a href="https://account.cnblogs.com/settings/account">账号设置</a>
                            <a href="javascript:void(0)" id="navbar_lite_mode_toggle" title="简洁模式会使用简洁款皮肤显示所有博客">
    简洁模式 <img id="navbar_lite_mode_on" src="./使用mybatis plus 操作数据库_files/lite-mode-check.svg" class="hide"><span id="navbar_lite_mode_spinner" class="hide">...</span>
</a>
                            <a href="javascript:void(0)" onclick="account.logout();">退出登录</a>
                        </div>
                    </div>
                    <a class="navbar-anonymous" href="https://account.cnblogs.com/signup" style="display: inline;">注册</a>
                    <a class="navbar-anonymous" href="javascript:void(0);" onclick="account.login()" style="display: inline;">登录</a>
                </li>
            </ul>
        </nav>
    </div>

    
    <!--done-->
<div id="banner"><div id="bnr_pic">
<!--done-->
<div class="header">
	<div class="headerText">
		<a id="Header1_HeaderTitle" class="headermaintitle HeaderMainTitle" href="https://www.cnblogs.com/yg_zhang/">自由港</a>
<br>
	</div><br>
	<div class="headerDis"></div>
</div>

</div></div>
<div id="main">
	<!-- left starts -->
	<div id="left">
		<div id="mystats">
			<br>
				<!--done-->
<div class="blogStats">
随笔 - 373&nbsp;
文章 - 4&nbsp;
评论 - 83&nbsp;
阅读 - 
<span title="总阅读数: 999836">
99万</span>&nbsp;
</div>


			
		</div>
		<div id="mylinks">

<a id="blog_nav_sitehome" class="menu" href="https://www.cnblogs.com/">
博客园</a>
&nbsp;&nbsp;
<a id="blog_nav_myhome" class="menu" href="https://www.cnblogs.com/yg_zhang/">
首页</a>
&nbsp;&nbsp;

<a id="blog_nav_newpost" class="menu" href="https://i.cnblogs.com/EditPosts.aspx?opt=1">
新随笔</a>
&nbsp;&nbsp;
<a id="blog_nav_contact" class="menu" href="https://msg.cnblogs.com/send/%E8%87%AA%E7%94%B1%E6%B8%AF">
联系</a>&nbsp;&nbsp;
<a id="blog_nav_admin" class="menu" href="https://i.cnblogs.com/">
管理</a>
&nbsp;&nbsp;
<a id="blog_nav_rss" class="menu" href="javascript:void(0)" data-rss="https://www.cnblogs.com/yg_zhang/rss/">
订阅</a>&nbsp;
<a id="blog_nav_rss_image" href="https://www.cnblogs.com/yg_zhang/rss/">
    <img src="./使用mybatis plus 操作数据库_files/xml.gif" alt="订阅">
</a>

</div>
		<div id="topics">
			<div id="post_detail">
<div class="post">
	<div class="postTitle">
		<h1>
<a id="cb_post_title_url" class="postTitle2 vertical-middle" href="https://www.cnblogs.com/yg_zhang/p/10736442.html">
    <span role="heading" aria-level="2">使用mybatis plus 操作数据库</span>
    



</a>
</h1>
	</div>
	<div id="cnblogs_post_body" class="blogpost-body blogpost-body-html">
<p>mybatis plus 是基于mybatis 的一个增强包，比 mybatis 更加容易使用。</p>
<p>特点:</p>
<p>1.分页支持</p>
<p>2.支持自定义查询。</p>
<p>3.简单的情况下，不需要写map.xml 文件</p>
<p>4.支持租户过滤</p>
<p>&nbsp;</p>
<p>下面介绍一下 它的使用方法</p>
<p>1.引入jar包。</p>
<p>在 pom.xml 增加</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre><span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">dependency</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>
            <span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">groupId</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>com.baomidou<span style="color: rgba(0, 0, 255, 1)">&lt;/</span><span style="color: rgba(128, 0, 0, 1)">groupId</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>
            <span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">artifactId</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>mybatis-plus-boot-starter<span style="color: rgba(0, 0, 255, 1)">&lt;/</span><span style="color: rgba(128, 0, 0, 1)">artifactId</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>
            <span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">version</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>3.1.0<span style="color: rgba(0, 0, 255, 1)">&lt;/</span><span style="color: rgba(128, 0, 0, 1)">version</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>
        <span style="color: rgba(0, 0, 255, 1)">&lt;/</span><span style="color: rgba(128, 0, 0, 1)">dependency</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>


        <span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">dependency</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>
            <span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">groupId</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>com.alibaba<span style="color: rgba(0, 0, 255, 1)">&lt;/</span><span style="color: rgba(128, 0, 0, 1)">groupId</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>
            <span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">artifactId</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>druid-spring-boot-starter<span style="color: rgba(0, 0, 255, 1)">&lt;/</span><span style="color: rgba(128, 0, 0, 1)">artifactId</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>
            <span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">version</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>1.1.10<span style="color: rgba(0, 0, 255, 1)">&lt;/</span><span style="color: rgba(128, 0, 0, 1)">version</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>
        <span style="color: rgba(0, 0, 255, 1)">&lt;/</span><span style="color: rgba(128, 0, 0, 1)">dependency</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>

        <span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">dependency</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>
            <span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">groupId</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>mysql<span style="color: rgba(0, 0, 255, 1)">&lt;/</span><span style="color: rgba(128, 0, 0, 1)">groupId</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>
            <span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">artifactId</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>mysql-connector-java<span style="color: rgba(0, 0, 255, 1)">&lt;/</span><span style="color: rgba(128, 0, 0, 1)">artifactId</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span>
        <span style="color: rgba(0, 0, 255, 1)">&lt;/</span><span style="color: rgba(128, 0, 0, 1)">dependency</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span></pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>2.配置使用数据源</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre>spring:
  datasource:
    url: jdbc:mysql://localhost:3306/wuxianji?useUnicode=true&amp;characterEncoding=utf8&amp;useSSL=false&amp;serverTimezone=GMT%2B8
    username: root
    password: root
    type: com.alibaba.druid.pool.DruidDataSource
    druid:
      # 下面为连接池的补充设置，应用到上面所有数据源中
      # 初始化大小，最小，最大
      initial-size: 5
      min-idle: 5
      max-active: 20
      # 配置获取连接等待超时的时间
      max-wait: 60000
      # 配置间隔多久才进行一次检测，检测需要关闭的空闲连接，单位是毫秒
      time-between-eviction-runs-millis: 60000
      # 配置一个连接在池中最小生存的时间，单位是毫秒
      min-evictable-idle-time-millis: 300000
      validation-query: SELECT 1 FROM DUAL
      test-while-idle: true
      test-on-borrow: false
      test-on-return: false
      # 打开PSCache，并且指定每个连接上PSCache的大小
      pool-prepared-statements: true
      #   配置监控统计拦截的filters，去掉后监控界面sql无法统计，'wall'用于防火墙
      max-pool-prepared-statement-per-connection-size: 20
      filters: stat,wall
      use-global-data-source-stat: true
      # 通过connectProperties属性来打开mergeSql功能；慢SQL记录
      connect-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
      # 配置监控服务器
      stat-view-servlet:
        login-username: admin
        login-password: 123456
        reset-enable: false
        url-pattern: /druid/*
        # 添加IP白名单
        #allow:
        # 添加IP黑名单，当白名单和黑名单重复时，黑名单优先级更高
        #deny:
      web-stat-filter:
        # 添加过滤规则
        url-pattern: /*
        # 忽略过滤格式
        exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"</pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>这里我们使用 druid 作为数据源</p>
<p>3.配置 mybatis plus&nbsp;</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre>mybatis-plus:
  mapper-locations: classpath:/mapper/**/*.xml
  global-config:
      refresh: true # 刷新xml文件
      db-config:
            logic-delete-value: 1 #默认值1
            logic-not-delete-value: 0 #默认值0</pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>&nbsp;这里指定了mapper xml 文件的位置。</p>
<p>4. 创建mybatis plus 配置java 文件</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre><span style="color: rgba(0, 0, 255, 1)">package</span><span style="color: rgba(0, 0, 0, 1)"> com.example.config;

</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> com.baomidou.mybatisplus.core.injector.ISqlInjector;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> com.baomidou.mybatisplus.core.parser.ISqlParser;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> com.baomidou.mybatisplus.extension.incrementer.H2KeyGenerator;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> com.baomidou.mybatisplus.extension.plugins.tenant.TenantHandler;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> com.baomidou.mybatisplus.extension.plugins.tenant.TenantSqlParser;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> net.sf.jsqlparser.expression.LongValue;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> org.mybatis.spring.annotation.MapperScan;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> org.springframework.context.annotation.Bean;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> org.springframework.context.annotation.Configuration;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> net.sf.jsqlparser.expression.Expression;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> net.sf.jsqlparser.expression.LongValue;


</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> java.util.ArrayList;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> java.util.List;

@Configuration
@MapperScan(</span>"com.example.demo.dao"<span style="color: rgba(0, 0, 0, 1)">)
</span><span style="color: rgba(0, 0, 255, 1)">public</span> <span style="color: rgba(0, 0, 255, 1)">class</span><span style="color: rgba(0, 0, 0, 1)"> MybatisPlusConfig {

    @Bean
    </span><span style="color: rgba(0, 0, 255, 1)">public</span><span style="color: rgba(0, 0, 0, 1)"> PerformanceInterceptor performanceInterceptor(){
        </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> PerformanceInterceptor();
    }

    @Bean
    </span><span style="color: rgba(0, 0, 255, 1)">public</span><span style="color: rgba(0, 0, 0, 1)"> ISqlInjector sqlInjector() {
        </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> LogicSqlInjector();
    }

    </span><span style="color: rgba(0, 128, 0, 1)">/**</span><span style="color: rgba(0, 128, 0, 1)">
     * 分页插件
     </span><span style="color: rgba(0, 128, 0, 1)">*/</span><span style="color: rgba(0, 0, 0, 1)">
    @Bean
    </span><span style="color: rgba(0, 0, 255, 1)">public</span><span style="color: rgba(0, 0, 0, 1)"> PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor</span>= <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> PaginationInterceptor();

        List</span>&lt;ISqlParser&gt; sqlParserList = <span style="color: rgba(0, 0, 255, 1)">new</span> ArrayList&lt;&gt;<span style="color: rgba(0, 0, 0, 1)">();
        TenantSqlParser tenantSqlParser </span>= <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> TenantSqlParser();
        tenantSqlParser.setTenantHandler(</span><span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> TenantHandler() {
            @Override
            </span><span style="color: rgba(0, 0, 255, 1)">public</span><span style="color: rgba(0, 0, 0, 1)"> Expression getTenantId() {
                </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 0, 255, 1)">new</span> LongValue(1L<span style="color: rgba(0, 0, 0, 1)">);
            }

            @Override
            </span><span style="color: rgba(0, 0, 255, 1)">public</span><span style="color: rgba(0, 0, 0, 1)"> String getTenantIdColumn() {
                </span><span style="color: rgba(0, 0, 255, 1)">return</span> "tenant_id"<span style="color: rgba(0, 0, 0, 1)">;
            }

            @Override
            </span><span style="color: rgba(0, 0, 255, 1)">public</span> <span style="color: rgba(0, 0, 255, 1)">boolean</span><span style="color: rgba(0, 0, 0, 1)"> doTableFilter(String tableName) {
                </span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)"> 这里可以判断是否过滤表</span>

            <span style="color: rgba(0, 0, 255, 1)">if</span> ("User_"<span style="color: rgba(0, 0, 0, 1)">.equals(tableName)) {
                </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 0, 255, 1)">true</span><span style="color: rgba(0, 0, 0, 1)">;
            }
                </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 0, 255, 1)">false</span><span style="color: rgba(0, 0, 0, 1)">;
            }
        });
        sqlParserList.add(tenantSqlParser);
        paginationInterceptor.setSqlParserList(sqlParserList);
        </span><span style="color: rgba(0, 0, 255, 1)">return</span><span style="color: rgba(0, 0, 0, 1)"> paginationInterceptor;
    }
}</span></pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>这里支持性能分析，逻辑删除，租户过滤，物理分页。</p>
<p>&nbsp;</p>
<p>5.下面以一个操作一个用户表为例，介绍一下 具体的用法。</p>
<p>5.1 创建一个用户表</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre><span style="color: rgba(0, 0, 255, 1)">CREATE</span> <span style="color: rgba(0, 0, 255, 1)">TABLE</span><span style="color: rgba(0, 0, 0, 1)"> `user_` (
  `id_` </span><span style="color: rgba(0, 0, 255, 1)">bigint</span>(<span style="color: rgba(128, 0, 0, 1); font-weight: bold">11</span>) <span style="color: rgba(128, 128, 128, 1)">NOT</span> <span style="color: rgba(0, 0, 255, 1)">NULL</span> <span style="color: rgba(0, 0, 255, 1)">DEFAULT</span> <span style="color: rgba(255, 0, 0, 1)">'</span><span style="color: rgba(255, 0, 0, 1)">0</span><span style="color: rgba(255, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">,
  `name_` </span><span style="color: rgba(0, 0, 255, 1)">varchar</span>(<span style="color: rgba(128, 0, 0, 1); font-weight: bold">255</span>) <span style="color: rgba(0, 0, 255, 1)">DEFAULT</span> <span style="color: rgba(0, 0, 255, 1)">NULL</span><span style="color: rgba(0, 0, 0, 1)">,
  `age` </span><span style="color: rgba(0, 0, 255, 1)">int</span>(<span style="color: rgba(128, 0, 0, 1); font-weight: bold">11</span>) <span style="color: rgba(0, 0, 255, 1)">DEFAULT</span> <span style="color: rgba(0, 0, 255, 1)">NULL</span><span style="color: rgba(0, 0, 0, 1)">,
  `address` </span><span style="color: rgba(0, 0, 255, 1)">varchar</span>(<span style="color: rgba(128, 0, 0, 1); font-weight: bold">100</span>) <span style="color: rgba(0, 0, 255, 1)">DEFAULT</span> <span style="color: rgba(0, 0, 255, 1)">NULL</span><span style="color: rgba(0, 0, 0, 1)">,
  `isDelete` </span><span style="color: rgba(0, 0, 255, 1)">int</span>(<span style="color: rgba(128, 0, 0, 1); font-weight: bold">11</span>) <span style="color: rgba(0, 0, 255, 1)">DEFAULT</span> <span style="color: rgba(0, 0, 255, 1)">NULL</span><span style="color: rgba(0, 0, 0, 1)">,
  </span><span style="color: rgba(0, 0, 255, 1)">PRIMARY</span> <span style="color: rgba(0, 0, 255, 1)">KEY</span><span style="color: rgba(0, 0, 0, 1)"> (`id_`)
) ENGINE</span><span style="color: rgba(128, 128, 128, 1)">=</span>InnoDB <span style="color: rgba(0, 0, 255, 1)">DEFAULT</span> CHARSET<span style="color: rgba(128, 128, 128, 1)">=</span>utf8;</pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>5.2 创建对应的User.java类</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre><span style="color: rgba(0, 0, 0, 1)">package com.example.demo.model;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

</span><span style="color: rgba(0, 128, 0, 1)">@TableName</span>(value <span style="color: rgba(128, 128, 128, 1)">=</span><span style="color: rgba(0, 0, 0, 1)"> "User_")
</span><span style="color: rgba(0, 0, 255, 1)">public</span> class <span style="color: rgba(255, 0, 255, 1)">User</span><span style="color: rgba(0, 0, 0, 1)"> {

    </span><span style="color: rgba(0, 128, 0, 1)">@TableId</span>(value<span style="color: rgba(128, 128, 128, 1)">=</span><span style="color: rgba(0, 0, 0, 1)">"id_")
    private </span><span style="color: rgba(0, 0, 255, 1)">Long</span><span style="color: rgba(0, 0, 0, 1)"> id;



    </span><span style="color: rgba(0, 128, 0, 1)">@TableField</span>(value<span style="color: rgba(128, 128, 128, 1)">=</span><span style="color: rgba(0, 0, 0, 1)">"name_")
    private String name;
    private </span><span style="color: rgba(0, 0, 255, 1)">Integer</span><span style="color: rgba(0, 0, 0, 1)"> age;
    private String address;
    </span><span style="color: rgba(0, 128, 0, 1)">@TableLogic</span>
    <span style="color: rgba(0, 128, 0, 1)">@TableField</span>(value<span style="color: rgba(128, 128, 128, 1)">=</span><span style="color: rgba(0, 0, 0, 1)">"isDelete")
    private </span><span style="color: rgba(0, 0, 255, 1)">Integer</span><span style="color: rgba(0, 0, 0, 1)"> isDelete;

  

  
}</span></pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>这里去掉了get 和 set 方法。</p>
<p>5.3 创建 DAO操作数据库</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre><span style="color: rgba(0, 0, 255, 1)">package</span><span style="color: rgba(0, 0, 0, 1)"> com.example.demo.dao;

</span><span style="color: rgba(0, 0, 255, 1)">import</span>  com.example.demo.model.*<span style="color: rgba(0, 0, 0, 1)">;
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> com.baomidou.mybatisplus.core.mapper.BaseMapper;

</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> java.util.Map;

</span><span style="color: rgba(0, 0, 255, 1)">public</span> <span style="color: rgba(0, 0, 255, 1)">interface</span> UserMapper <span style="color: rgba(0, 0, 255, 1)">extends</span> BaseMapper&lt;User&gt;<span style="color: rgba(0, 0, 0, 1)"> {

    </span><span style="color: rgba(0, 0, 255, 1)">int</span> updName(Map&lt;String,Object&gt;<span style="color: rgba(0, 0, 0, 1)"> params);
}</span></pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>这个类继承了 BaseMapper 接口，自动有增查改删操作。</p>
<p>5.4 开始测试</p>
<p>1.列表查询</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre> <span style="color: rgba(0, 0, 255, 1)">private</span><span style="color: rgba(0, 0, 0, 1)"> UserMapper userMapper;

    </span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">@Test</span>
    <span style="color: rgba(0, 0, 255, 1)">public</span> <span style="color: rgba(0, 0, 255, 1)">void</span><span style="color: rgba(0, 0, 0, 1)"> testSelect() {
        System.out.println((</span>"----- selectAll method test ------"<span style="color: rgba(0, 0, 0, 1)">));
        List</span>&lt;User&gt; userList = userMapper.selectList(<span style="color: rgba(0, 0, 255, 1)">null</span><span style="color: rgba(0, 0, 0, 1)">);
        Assert.assertEquals(</span>5<span style="color: rgba(0, 0, 0, 1)">, userList.size());
        userList.forEach(System.out::println);
    }</span></pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>2.增加用户</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre><span style="color: rgba(0, 0, 255, 1)">public</span> <span style="color: rgba(0, 0, 255, 1)">void</span><span style="color: rgba(0, 0, 0, 1)"> add() {
        User user</span>=<span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> User();
        user.setId(</span>14L<span style="color: rgba(0, 0, 0, 1)">);
        user.setName(</span>"关羽"<span style="color: rgba(0, 0, 0, 1)">);
        user.setAge(</span>12<span style="color: rgba(0, 0, 0, 1)">);
        userMapper.insert(user);
    }</span></pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>3.更新实体对象</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre> <span style="color: rgba(0, 0, 255, 1)">public</span> <span style="color: rgba(0, 0, 255, 1)">void</span><span style="color: rgba(0, 0, 0, 1)"> upd() {
        User user</span>=<span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> User();
        user.setId(</span>13L<span style="color: rgba(0, 0, 0, 1)">);
        user.setName(</span>"zyg"<span style="color: rgba(0, 0, 0, 1)">);
        user.setAge(</span>13<span style="color: rgba(0, 0, 0, 1)">);
        userMapper.updateById(user);
    }</span></pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>4.自定义条件更新</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">public</span> <span style="color: rgba(0, 0, 255, 1)">void</span><span style="color: rgba(0, 0, 0, 1)"> updWrap() {
        User user</span>=<span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> User();
        user.setAddress(</span>"广州"<span style="color: rgba(0, 0, 0, 1)">);
        user.setAge(</span>23<span style="color: rgba(0, 0, 0, 1)">);
        userMapper.update(user,</span><span style="color: rgba(0, 0, 255, 1)">new</span> UpdateWrapper&lt;User&gt;().eq("name_","a").or().eq("name_","b"<span style="color: rgba(0, 0, 0, 1)">));
    }</span></pre>
</div>
<p>这个意思是他会根据姓名 为 a 或 b 的用户更新他的地址和年龄字段。</p>
<p>5.根据 MAP 传值更新</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre> <span style="color: rgba(0, 0, 255, 1)">public</span> <span style="color: rgba(0, 0, 255, 1)">void</span><span style="color: rgba(0, 0, 0, 1)"> updName() {
        Map</span>&lt;String,Object&gt; params=<span style="color: rgba(0, 0, 255, 1)">new</span> HashMap&lt;&gt;<span style="color: rgba(0, 0, 0, 1)">();

        params.put(</span>"id",14<span style="color: rgba(0, 0, 0, 1)">);
        params.put(</span>"name","趙雲"<span style="color: rgba(0, 0, 0, 1)">);

        </span><span style="color: rgba(0, 0, 255, 1)">int</span> i=<span style="color: rgba(0, 0, 0, 1)"> userMapper.updName(params);
        System.err.println(i);
    }</span></pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>这里我们需要在 User.xml 中增加</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">update </span><span style="color: rgba(255, 0, 0, 1)">id</span><span style="color: rgba(0, 0, 255, 1)">="updName"</span><span style="color: rgba(255, 0, 0, 1)"> parameterType</span><span style="color: rgba(0, 0, 255, 1)">="java.util.HashMap"</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span><span style="color: rgba(0, 0, 0, 1)">
        update user_ set name_=#{name} where id_=#{id}
    </span><span style="color: rgba(0, 0, 255, 1)">&lt;/</span><span style="color: rgba(128, 0, 0, 1)">update</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span></pre>
</div>
<p>也需要在UserMapper 内中增加方法</p>
<div class="cnblogs_code">
<pre>int updName(Map<span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">String</span><span style="color: rgba(255, 0, 0, 1)">,Object</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span> params);</pre>
</div>
<p>6.分页获取数据</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">public  void getPage(){
        Page</span><span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">User</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span> page = new Page<span style="color: rgba(0, 0, 255, 1)">&lt;&gt;</span><span style="color: rgba(0, 0, 0, 1)">(1, 5);
        IPage</span><span style="color: rgba(0, 0, 255, 1)">&lt;</span><span style="color: rgba(128, 0, 0, 1)">User</span><span style="color: rgba(0, 0, 255, 1)">&gt;</span><span style="color: rgba(0, 0, 0, 1)"> userIPage = userMapper.selectPage(page, null);
        System.err.println(userIPage.getRecords());

    }</span></pre>
</div>
<p>这个需要配合MybatisPlusConfig 的分页配置，才可以生效。</p>
<p>7.当分页返回的数据不是 User 对象时，我们可以返回 Map对象。</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre><span style="color: rgba(0, 0, 255, 1)">public</span>  <span style="color: rgba(0, 0, 255, 1)">void</span><span style="color: rgba(0, 0, 0, 1)"> getPageMap(){
        Page page </span>= <span style="color: rgba(0, 0, 255, 1)">new</span> Page&lt;&gt;(1, 5<span style="color: rgba(0, 0, 0, 1)">);

        Wrapper wrapper</span>=<span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> QueryWrapper();
        ((QueryWrapper) wrapper).ge(</span>"id_",2<span style="color: rgba(0, 0, 0, 1)">);

        IPage</span>&lt;Map&lt;String,Object&gt;&gt; userIPage =<span style="color: rgba(0, 0, 0, 1)"> userMapper.selectMapsPage(page,wrapper);
        System.err.println(userIPage.getRecords());

    }</span></pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>这里我们查询Id_ 大于 2的用户分页列表。</p>
<p>8.逻辑删除用户</p>
<p>如果平台中数据不需要做实际删除，我们可以配置逻辑删除</p>
<p>配置方法如下：</p>
<p>MybatisPlusConfig&nbsp; 中指定了&nbsp;</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">@Bean
</span><span style="color: rgba(0, 0, 255, 1)">public</span><span style="color: rgba(0, 0, 0, 1)"> ISqlInjector sqlInjector() {
    </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> LogicSqlInjector();
}</span></pre>
</div>
<p>配置这个就支持逻辑删除</p>
<p>application.yml配置如下：</p>
<pre>mybatis-plus:<br>  mapper-locations: classpath:/mapper/**/*.xml<br>  global-config:<br>      refresh: true # 刷新xml文件<br>      db-config:<br>            logic-delete-value: 1 #默认值1<br>            logic-not-delete-value: 0 #默认值0<br>这里指定逻辑删除 删除标记 为1 表示删除 为0 表示正常。<br>User 对象 需要指定</pre>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">@TableLogic
@TableField(value</span>="isDelete")</pre>
</div>
<p>指定逻辑删除字段。</p>
<p>删除代码</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">public</span>  <span style="color: rgba(0, 0, 255, 1)">void</span><span style="color: rgba(0, 0, 0, 1)"> delById(){
        userMapper.deleteById(</span>1L<span style="color: rgba(0, 0, 0, 1)">);
    }</span></pre>
</div>
<p>这样我们执行这个删除时，后端并不执行删除操作。</p>
<div class="cnblogs_code">
<pre> Time：9 ms -<span style="color: rgba(0, 0, 0, 1)"> ID：com.example.demo.dao.UserMapper.deleteById
Execute SQL：UPDATE User_ SET isDelete </span>= 1 WHERE id_ = 1 AND isDelete = 0</pre>
</div>
<p>后端执行的语句为 将 删除标记更新为1</p>
<p>9.分页配置根据租户查询。</p>
<p>需要配置</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre> List&lt;ISqlParser&gt; sqlParserList = <span style="color: rgba(0, 0, 255, 1)">new</span> ArrayList&lt;&gt;<span style="color: rgba(0, 0, 0, 1)">();
        TenantSqlParser tenantSqlParser </span>= <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> TenantSqlParser();
        tenantSqlParser.setTenantHandler(</span><span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> TenantHandler() {
            @Override
            </span><span style="color: rgba(0, 0, 255, 1)">public</span><span style="color: rgba(0, 0, 0, 1)"> Expression getTenantId() {
                </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 0, 255, 1)">new</span> LongValue(1L<span style="color: rgba(0, 0, 0, 1)">);
            }

            @Override
            </span><span style="color: rgba(0, 0, 255, 1)">public</span><span style="color: rgba(0, 0, 0, 1)"> String getTenantIdColumn() {
                </span><span style="color: rgba(0, 0, 255, 1)">return</span> "tenant_id"<span style="color: rgba(0, 0, 0, 1)">;
            }

            @Override
            </span><span style="color: rgba(0, 0, 255, 1)">public</span> <span style="color: rgba(0, 0, 255, 1)">boolean</span><span style="color: rgba(0, 0, 0, 1)"> doTableFilter(String tableName) {
                </span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)"> 这里可以判断是否过滤表</span>

            <span style="color: rgba(0, 0, 255, 1)">if</span> ("User_"<span style="color: rgba(0, 0, 0, 1)">.equals(tableName)) {
                </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 0, 255, 1)">true</span><span style="color: rgba(0, 0, 0, 1)">;
            }
                </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 0, 255, 1)">false</span><span style="color: rgba(0, 0, 0, 1)">;
            }
        });
        sqlParserList.add(tenantSqlParser);
        paginationInterceptor.setSqlParserList(sqlParserList);</span></pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>1.指定租户ID字段</p>
<p>2.返回租户ID值&nbsp;</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)"> @Override
            </span><span style="color: rgba(0, 0, 255, 1)">public</span><span style="color: rgba(0, 0, 0, 1)"> Expression getTenantId() {
                </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 0, 255, 1)">new</span> LongValue(1L<span style="color: rgba(0, 0, 0, 1)">);
            }</span></pre>
</div>
<p>3.允许表过滤</p>
<p>有些表是不需要通过租户过滤的，可以修改方法</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre><span style="color: rgba(0, 0, 0, 1)"> @Override
            </span><span style="color: rgba(0, 0, 255, 1)">public</span> <span style="color: rgba(0, 0, 255, 1)">boolean</span><span style="color: rgba(0, 0, 0, 1)"> doTableFilter(String tableName) {
                </span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)"> 这里可以判断是否过滤表</span>
                <span style="color: rgba(0, 0, 255, 1)">if</span> ("User_"<span style="color: rgba(0, 0, 0, 1)">.equals(tableName)) {
                    </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 0, 255, 1)">true</span><span style="color: rgba(0, 0, 0, 1)">;
                }
                </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 0, 255, 1)">false</span><span style="color: rgba(0, 0, 0, 1)">;
            }</span></pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>10.乐观锁支持</p>
<p>乐观锁的原理是，每一条数据都带有一个版本。</p>
<p>比如当前都版本为1.</p>
<p>在更新数据时，会将版本加一进行更新，如果A 进行更新，那么这个时候版本变为 2，如果B 同A一起发起更新，那么这个时候就更新不到，给出提示。</p>
<p>配置方法：</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">@Version
    </span><span style="color: rgba(0, 0, 255, 1)">private</span> Integer version;</pre>
</div>
<p>User 类中增加一个字段 为 version</p>
<p>配置增加乐观锁</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">@Bean
    </span><span style="color: rgba(0, 0, 255, 1)">public</span><span style="color: rgba(0, 0, 0, 1)"> OptimisticLockerInterceptor optimisticLockerInterceptor() {
        </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> OptimisticLockerInterceptor();
    }</span></pre>
</div>
<p>编写更新代码</p>
<div class="cnblogs_code"><div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div>
<pre><span style="color: rgba(0, 0, 255, 1)">public</span> <span style="color: rgba(0, 0, 255, 1)">void</span><span style="color: rgba(0, 0, 0, 1)"> upd() {
        User user</span>=<span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> User();
        user.setId(</span>13L<span style="color: rgba(0, 0, 0, 1)">);
        user.setName(</span>"zyg"<span style="color: rgba(0, 0, 0, 1)">);
        user.setAge(</span>13<span style="color: rgba(0, 0, 0, 1)">);
        user.setVersion(</span>1<span style="color: rgba(0, 0, 0, 1)">);
        </span><span style="color: rgba(0, 0, 255, 1)">if</span>(  userMapper.updateById(user)&gt;0<span style="color: rgba(0, 0, 0, 1)">){
            System.err.println(</span>"更新成功"<span style="color: rgba(0, 0, 0, 1)">);
        }
        </span><span style="color: rgba(0, 0, 255, 1)">else</span><span style="color: rgba(0, 0, 0, 1)"> {
            System.err.println(</span>"被其他人更新"<span style="color: rgba(0, 0, 0, 1)">);
        }
    }</span></pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a href="javascript:void(0);" onclick="copyCnblogsCode(this)" title="复制代码"><img src="./使用mybatis plus 操作数据库_files/copycode.gif" alt="复制代码"></a></span></div></div>
<p>执行上面的代码</p>
<div class="cnblogs_code">
<pre> Time：7 ms - ID：com.example.demo.dao.UserMapper.updateById
Execute SQL：UPDATE User_ SET name_ = 'zyg', age = 13, version = 2 WHERE id_ = 13 AND version = 1</pre>
</div>
<p>这里我们可以看到他会自动将版本字段加1，如果执行成功就变成了2，当第二个人执行更新的时候，还是用版本1 进行更新，数据就更新不到了。</p>
<p>&nbsp;</p>
</div>
<div class="clear"></div>
<div id="blog_post_info_block" role="contentinfo">
<div id="EntryTag">
    标签: 
            <a href="https://www.cnblogs.com/yg_zhang/tag/mybatis%20plus/">mybatis plus</a></div>

    <div id="blog_post_info">
<div id="green_channel">
        <a href="javascript:void(0);" id="green_channel_digg" onclick="DiggIt(10736442,cb_blogId,1);green_channel_success(this,&#39;谢谢推荐！&#39;);">好文要顶</a>
        <a id="green_channel_follow" onclick="follow(&#39;629b310b-63cf-dd11-9e4d-001cf0cd104b&#39;);" href="javascript:void(0);">关注我</a>
    <a id="green_channel_favorite" onclick="AddToWz(cb_entryId);return false;" href="javascript:void(0);">收藏该文</a>
    <a id="green_channel_weibo" href="javascript:void(0);" title="分享至新浪微博" onclick="ShareToTsina()"><img src="./使用mybatis plus 操作数据库_files/icon_weibo_24.png" alt=""></a>
    <a id="green_channel_wechat" href="javascript:void(0);" title="分享至微信" onclick="shareOnWechat()"><img src="./使用mybatis plus 操作数据库_files/wechat.png" alt=""></a>
</div>
<div id="author_profile">
    <div id="author_profile_info" class="author_profile_info">
            <a href="https://home.cnblogs.com/u/yg_zhang/" target="_blank"><img src="./使用mybatis plus 操作数据库_files/sample_face.gif" class="author_avatar" alt=""></a>
        <div id="author_profile_detail" class="author_profile_info">
            <a href="https://home.cnblogs.com/u/yg_zhang/">自由港</a><br>
            <a href="https://home.cnblogs.com/u/yg_zhang/followees/">关注 - 0</a><br>
            <a href="https://home.cnblogs.com/u/yg_zhang/followers/">粉丝 - 48</a>
        </div>
    </div>
    <div class="clear"></div>
    <div id="author_profile_honor"></div>
    <div id="author_profile_follow">
                <a href="javascript:void(0);" onclick="follow(&#39;629b310b-63cf-dd11-9e4d-001cf0cd104b&#39;);return false;">+加关注</a>
    </div>
</div>
<div id="div_digg">
    <div class="diggit" onclick="votePost(10736442,&#39;Digg&#39;)">
        <span class="diggnum" id="digg_count">2</span>
    </div>
    <div class="buryit" onclick="votePost(10736442,&#39;Bury&#39;)">
        <span class="burynum" id="bury_count">0</span>
    </div>
    <div class="clear"></div>
    <div class="diggword" id="digg_tips">
    </div>
</div>

<script type="text/javascript">
    currentDiggType = 0;
</script></div>
    <div class="clear"></div>
    <div id="post_next_prev">

    <a href="https://www.cnblogs.com/yg_zhang/p/10730507.html" class="p_n_p_prefix">« </a> 上一篇：    <a href="https://www.cnblogs.com/yg_zhang/p/10730507.html" title="发布于 2019-04-18 16:34">IDEA springboot 项目静态文件修改不更新的问题</a>
    <br>
    <a href="https://www.cnblogs.com/yg_zhang/p/10737535.html" class="p_n_p_prefix">» </a> 下一篇：    <a href="https://www.cnblogs.com/yg_zhang/p/10737535.html" title="发布于 2019-04-19 17:51">使用 mybatis plus 动态数据源</a>

</div>
</div>
	<div class="postDesc">posted on 
<span id="post-date">2019-04-19 15:55</span>&nbsp;
<a href="https://www.cnblogs.com/yg_zhang/">自由港</a>&nbsp;
阅读(<span id="post_view_count">16397</span>)&nbsp;
评论(<span id="post_comment_count">0</span>)&nbsp;
<a href="https://i.cnblogs.com/EditPosts.aspx?postid=10736442" rel="nofollow">编辑</a>&nbsp;
<a href="javascript:void(0)" onclick="AddToWz(10736442);return false;">收藏</a>&nbsp;
<a href="javascript:void(0)" onclick="reportManager.report({ currentUserId: &#39;&#39;, targetType: &#39;blogPost&#39;, targetId: &#39;10736442&#39;, targetLink: &#39;https://www.cnblogs.com/yg_zhang/p/10736442.html&#39;, title: &#39;使用mybatis plus 操作数据库&#39; })">举报</a></div>
</div>



<script>
    var cb_entryId = 10736442, cb_entryCreatedDate = '2019-04-19 15:55', cb_postType = 1;
    var allowComments = true, cb_blogId = 11281, cb_blogApp = 'yg_zhang', cb_blogUserGuid = '629b310b-63cf-dd11-9e4d-001cf0cd104b';
    mermaidRender.render()
    markdown_highlight()
    zoomManager.apply("#cnblogs_post_body img:not(.code_img_closed):not(.code_img_opened)");
    updatePostStats(
            [cb_entryId],
            function(id, count) { $("#post_view_count").text(count) },
            function(id, count) { $("#post_comment_count").text(count) })
</script>
<a id="!comments"></a>
<div id="blog-comments-placeholder"></div>
<div id="comment_form" class="commentform">
    <a name="commentform"></a>
    <div id="divCommentShow"></div>
    <div id="comment_nav"><span id="span_refresh_tips"></span><a href="javascript:void(0);" onclick="return RefreshCommentList();" id="lnk_RefreshComments" runat="server" clientidmode="Static">刷新评论</a><a href="https://www.cnblogs.com/yg_zhang/p/10736442.html#" onclick="return RefreshPage();">刷新页面</a><a href="https://www.cnblogs.com/yg_zhang/p/10736442.html#top">返回顶部</a></div>
    <div id="comment_form_container" style="visibility: visible;"><div class="login_tips">
    登录后才能查看或发表评论，立即 <a rel="nofollow" href="javascript:void(0);" class="underline" onclick="return account.login(&#39;!comments&#39;);">登录</a> 或者
    <a href="https://www.cnblogs.com/">逛逛</a> 博客园首页
</div>
</div>
    <div class="ad_text_commentbox" id="ad_text_under_commentbox"></div>
    <div id="cnblogs_ch"><a href="https://developer.huawei.com/consumer/cn/forum/topic/0201820468285270027?fid=23&amp;ha_source=bokeyuan" target="_blank" onclick="gtag(&#39;event&#39;, &#39;click&#39;, {&#39;event_category&#39;: &#39;ad&#39;, &#39;event_label&#39;: &#39;T2-华为专区-HWD故事征集&#39;})">【推荐】华为 HWD 2022 故事征集，分享最打动你的科技女性故事</a><br><a href="https://brands.cnblogs.com/huawei" target="_blank" onclick="gtag(&#39;event&#39;, &#39;click&#39;, {&#39;event_category&#39;: &#39;ad&#39;, &#39;event_label&#39;: &#39;T2-华为专区&#39;})">【推荐】华为开发者专区，与开发者一起构建万物互联的智能世界</a><br></div>
    <div id="opt_under_post"></div>
    <div id="cnblogs_c1" class="under-post-card">
            <div id="div-gpt-ad-1592365906576-0" style="width: 300px; height: 250px;" data-google-query-id="CKOGwJGWuPYCFcN_vQodrPcH8w"><div id="google_ads_iframe_/1090369/C1_0__container__" style="border: 0pt none;"><iframe id="google_ads_iframe_/1090369/C1_0" name="google_ads_iframe_/1090369/C1_0" title="3rd party ad content" width="300" height="250" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" role="region" aria-label="Advertisement" tabindex="0" sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" style="border: 0px; vertical-align: bottom;" data-google-container-id="1" data-load-complete="true" src="./使用mybatis plus 操作数据库_files/saved_resource.html"></iframe></div></div>
    </div>
    <div id="under_post_card1"><div class="under-post-card">
<b>编辑推荐：</b>
<br>

· <a href="https://www.cnblogs.com/wei325/p/15957951.html" target="_blank">.Net Core 中无处不在的 Async/Await 是如何提升性能的？</a>
    <br>
· <a href="https://www.cnblogs.com/doNetTom/p/15961292.html" target="_blank">分布式系统改造方案 —— 老旧系统改造篇</a>
    <br>
· <a href="https://www.cnblogs.com/hez2010/p/a-complete-guide-for-pattern-matching-in-csharp.html" target="_blank">C# 模式匹配完全指南</a>
    <br>
· <a href="https://www.cnblogs.com/hkfyf/p/15949528.html" target="_blank">C# 异步编程由浅入深（三）细说 Awaiter</a>
    <br>
· <a href="https://www.cnblogs.com/coco1s/p/15944634.html" target="_blank">突破限制，CSS font-variation 可变字体的魅力 </a>
    <br>
</div></div>
        <div id="cnblogs_c2" class="under-post-card">
            <a href="https://developer.huawei.com/consumer/cn/forum/topic/0201820468285270027?fid=23&amp;ha_source=bokeyuan" rel="nofollow" target="_blank" onclick="countCreativeClicks(&#39;C2-华为专区-HWD2022&#39;)">
                <img src="./使用mybatis plus 操作数据库_files/35695-20220308114136319-1059306580.jpg" alt="" onload="countCreativeImpressions(&#39;C2-华为专区-HWD2022&#39;)">
            </a>
        </div>
    <div id="under_post_card2"><div class="itnews under-post-card">
    <b>最新新闻</b>：
    <br>
 ·          <a href="https://news.cnblogs.com/n/715333/" target="_blank">快手一分购，还要烧多久的钱？</a>
        <br>
 ·          <a href="https://news.cnblogs.com/n/715332/" target="_blank">马斯克才是政商博弈大师</a>
        <br>
 ·          <a href="https://news.cnblogs.com/n/715331/" target="_blank">苹果把两颗M1芯片“粘”在一起，做出了地表最强台式机芯片</a>
        <br>
 ·          <a href="https://news.cnblogs.com/n/715316/" target="_blank">作者免费分享自己论文也不行，知名学术社交网站被判侵权</a>
        <br>
 ·          <a href="https://news.cnblogs.com/n/715330/" target="_blank">NASA开始组装“欧罗巴快船”：将于2024年前往木卫二</a>
        <br>
    » <a href="https://news.cnblogs.com/" title="IT 新闻" target="_blank">更多新闻...</a>
</div></div>
    <div id="HistoryToday" class="under-post-card"></div>
    <script type="text/javascript">
        var commentManager = new blogCommentManager();
        commentManager.renderComments(0);
        fixPostBody();

                window.tocManager.displayDisableTocTips = false;
                window.tocManager.generateToc();
            setTimeout(function() { incrementViewCount(cb_entryId); }, 50);        deliverT2();
        deliverC1C2();
        loadNewsAndKb();
LoadPostCategoriesTags(cb_blogId, cb_entryId);        LoadPostInfoBlock(cb_blogId, cb_entryId, cb_blogApp, cb_blogUserGuid);
        GetPrevNextPost(cb_entryId, cb_blogId, cb_entryCreatedDate, cb_postType);
        loadOptUnderPost();
        GetHistoryToday(cb_blogId, cb_blogApp, cb_entryCreatedDate);
    </script>
</div>

</div>


		</div>
	</div>
	<!-- left ends -->
	<!-- right starts -->
	<div id="right">
		<!-- 右侧工具部分 -->
		<div id="right_content">
	
			<div id="sidebar_news" class="newsItem"><!--done-->
<h2 class="listtitle">公告</h2>
<div class="newsItem">
	
<div id="blog-news">
    
    <div id="profile_block">
        昵称：
        <a href="https://home.cnblogs.com/u/yg_zhang/">
            自由港
        </a>
        <br>
        园龄：
        <a href="https://home.cnblogs.com/u/yg_zhang/" title="入园时间：2005-05-08">
            16年10个月
        </a>
        <br>
        粉丝：
        <a href="https://home.cnblogs.com/u/yg_zhang/followers/">
            48
        </a>
        <br>
        关注：
        <a href="https://home.cnblogs.com/u/yg_zhang/followees/">
            0
        </a>
        <div id="p_b_follow">
<a href="javascript:void(0)" onclick="follow(&#39;629b310b-63cf-dd11-9e4d-001cf0cd104b&#39;)">+加关注</a></div>
        <script>getFollowStatus('629b310b-63cf-dd11-9e4d-001cf0cd104b');</script>
    </div>
</div>
</div>

</div>
<div id="sidebar_c3"></div>
	
			<div id="calendar"><div id="calendar"><div id="blog-calendar" style="">

<table id="blogCalendar" class="Cal" cellspacing="0" cellpadding="0" title="Calendar" border="0">
    <tbody>
        <tr>
            <td colspan="7">
                <table class="CalTitle" cellspacing="0" border="0">
                    <tbody>
                        <tr>
                            <td class="CalNextPrev">
                                <a href="javascript:void(0);" onclick="loadBlogCalendar(&#39;2022/02/09&#39;); return false;">&lt;</a>
                            </td>
                            <td align="center">2022年3月</td>
                            <td align="right" class="CalNextPrev">
                                <a href="javascript:void(0);" onclick="loadBlogCalendar(&#39;2022/04/09&#39;); return false;">&gt;</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
    <tr>
        <th class="CalDayHeader" align="center" abbr="日" scope="col">日</th>
        <th class="CalDayHeader" align="center" abbr="一" scope="col">一</th>
        <th class="CalDayHeader" align="center" abbr="二" scope="col">二</th>
        <th class="CalDayHeader" align="center" abbr="三" scope="col">三</th>
        <th class="CalDayHeader" align="center" abbr="四" scope="col">四</th>
        <th class="CalDayHeader" align="center" abbr="五" scope="col">五</th>
        <th class="CalDayHeader" align="center" abbr="六" scope="col">六</th>
    </tr>
            <tr>
                            <td class="CalOtherMonthDay" align="center">27</td>
                            <td class="CalOtherMonthDay" align="center">28</td>
                        <td class="" align="center">
                            1
                        </td>
                        <td class="" align="center">
                            2
                        </td>
                        <td class="" align="center">
                            3
                        </td>
                        <td class="" align="center">
                            4
                        </td>
                    <td class="CalWeekendDay" align="center">
                        5
                    </td>
            </tr>
                <tr>
                        <td class="CalWeekendDay" align="center">
                            6
                        </td>
                            <td class="" align="center">
                                <a href="https://www.cnblogs.com/yg_zhang/archive/2022/03/07.html"><u>7</u></a>
                            </td>
                            <td class="" align="center">
                                8
                            </td>
                            <td class="CalTodayDay" align="center">
                                9
                            </td>
                            <td class="" align="center">
                                10
                            </td>
                            <td class="" align="center">
                                11
                            </td>
                        <td class="CalWeekendDay" align="center">
                            12
                        </td>
                </tr>
                <tr>
                        <td class="CalWeekendDay" align="center">
                            13
                        </td>
                            <td class="" align="center">
                                14
                            </td>
                            <td class="" align="center">
                                15
                            </td>
                            <td class="" align="center">
                                16
                            </td>
                            <td class="" align="center">
                                17
                            </td>
                            <td class="" align="center">
                                18
                            </td>
                        <td class="CalWeekendDay" align="center">
                            19
                        </td>
                </tr>
                <tr>
                        <td class="CalWeekendDay" align="center">
                            20
                        </td>
                            <td class="" align="center">
                                21
                            </td>
                            <td class="" align="center">
                                22
                            </td>
                            <td class="" align="center">
                                23
                            </td>
                            <td class="" align="center">
                                24
                            </td>
                            <td class="" align="center">
                                25
                            </td>
                        <td class="CalWeekendDay" align="center">
                            26
                        </td>
                </tr>
                <tr>
                        <td class="CalWeekendDay" align="center">
                            27
                        </td>
                            <td class="" align="center">
                                28
                            </td>
                            <td class="" align="center">
                                29
                            </td>
                            <td class="" align="center">
                                30
                            </td>
                            <td class="" align="center">
                                31
                            </td>
                            <td class="CalOtherMonthDay" align="center">
                                1
                            </td>
                        <td class="CalOtherMonthDay" align="center">
                            2
                        </td>
                </tr>
                <tr>
                        <td class="CalOtherMonthDay" align="center">
                            3
                        </td>
                            <td class="CalOtherMonthDay" align="center">
                                4
                            </td>
                            <td class="CalOtherMonthDay" align="center">
                                5
                            </td>
                            <td class="CalOtherMonthDay" align="center">
                                6
                            </td>
                            <td class="CalOtherMonthDay" align="center">
                                7
                            </td>
                            <td class="CalOtherMonthDay" align="center">
                                8
                            </td>
                        <td class="CalOtherMonthDay" align="center">
                            9
                        </td>
                </tr>
    </tbody>
</table></div></div>                
                    <script>loadBlogDefaultCalendar();</script></div>
			
				<div id="leftcontentcontainer">
					<div id="blog-sidecolumn"><!-- 搜索 -->
<div id="sidebar_search" class="sidebar-block">
    <div id="sidebar_search" class="mySearch">
        <h3 class="catListTitle">搜索</h3>
        <div id="sidebar_search_box">
            <div id="widget_my_zzk" class="div_my_zzk">
                <input type="text" id="q" onkeydown="return zzk_go_enter(event);" class="input_my_zzk">&nbsp;<input onclick="zzk_go()" type="button" value="找找看" id="btnZzk" class="btn_my_zzk">
            </div>
            
        </div>
    </div>
</div>

<!-- 常用链接 -->
<div id="sidebar_shortcut" class="sidebar-block">
<h3 class="catListTitle">
常用链接
</h3>
<ul>
    
<li><a href="https://www.cnblogs.com/yg_zhang/p/" title="我的博客的随笔列表">我的随笔</a></li>
<li><a href="https://www.cnblogs.com/yg_zhang/MyComments.html" title="我的发表过的评论列表">我的评论</a></li>
<li><a href="https://www.cnblogs.com/yg_zhang/OtherPosts.html" title="我评论过的随笔列表">我的参与</a></li>
<li><a href="https://www.cnblogs.com/yg_zhang/RecentComments.html" title="我的博客的评论列表">最新评论</a></li>
<li><a href="https://www.cnblogs.com/yg_zhang/tag/" title="我的博客的标签列表">我的标签</a></li>

</ul>
</div>

<!-- 最新随笔 -->


<!-- 我的标签 -->
<div id="sidebar_toptags" class="sidebar-block">
<h3>我的标签</h3>
<div id="MyTag">
    <ul>
                <li>
            <a href="https://www.cnblogs.com/yg_zhang/tag/oracle/">oracle<span class="tag-count">(4)</span></a>
        </li>
        <li>
            <a href="https://www.cnblogs.com/yg_zhang/tag/SSIS/">SSIS<span class="tag-count">(4)</span></a>
        </li>
        <li>
            <a href="https://www.cnblogs.com/yg_zhang/tag/KETTLE/">KETTLE<span class="tag-count">(2)</span></a>
        </li>
        <li>
            <a href="https://www.cnblogs.com/yg_zhang/tag/Jmeter/">Jmeter<span class="tag-count">(2)</span></a>
        </li>
        <li>
            <a href="https://www.cnblogs.com/yg_zhang/tag/springsecurity/">springsecurity<span class="tag-count">(2)</span></a>
        </li>
        <li>
            <a href="https://www.cnblogs.com/yg_zhang/tag/elasticsearch%20%20%E5%AE%89%E8%A3%85/">elasticsearch  安装<span class="tag-count">(2)</span></a>
        </li>
        <li>
            <a href="https://www.cnblogs.com/yg_zhang/tag/nginx%20%E5%8E%8B%E7%BC%A9%E9%85%8D%E7%BD%AE/">nginx 压缩配置<span class="tag-count">(1)</span></a>
        </li>
        <li>
            <a href="https://www.cnblogs.com/yg_zhang/tag/%E5%88%86%E5%B8%83%E5%BC%8F%E4%BA%8B%E5%8A%A1/">分布式事务<span class="tag-count">(1)</span></a>
        </li>
        <li>
            <a href="https://www.cnblogs.com/yg_zhang/tag/seata/">seata<span class="tag-count">(1)</span></a>
        </li>
        <li>
            <a href="https://www.cnblogs.com/yg_zhang/tag/http%E8%BF%9E%E6%8E%A5%E6%B1%A0/">http连接池<span class="tag-count">(1)</span></a>
        </li>
    <li>
        <a href="https://www.cnblogs.com/yg_zhang/tag/">更多</a>
    </li>

    </ul>
</div>
</div>

<!-- 积分与排名 -->


<!-- 随笔分类、随笔档案、文章分类、新闻分类、相册、链接 -->
<div id="sidebar_categories">

    <h1 class="catListTitle">
        
随笔分类



    </h1>
    <ul>
            <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/69353.html" class="category-item-link" rel="" target="">.net水笔(21)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/568866.html" class="category-item-link" rel="" target="">ACTIVITI(6)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/147966.html" class="category-item-link" rel="" target="">arcgis学习(6)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/78637.html" class="category-item-link" rel="" target="">DB2(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/269824.html" class="category-item-link" rel="" target="">flex(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/77412.html" class="category-item-link" rel="" target="">java(58)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/77090.html" class="category-item-link" rel="" target="">javascript(10)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/269818.html" class="category-item-link" rel="" target="">JBPM(7)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/1474332.html" class="category-item-link" rel="" target="">Jmeter 性能测试(16)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/1781071.html" class="category-item-link" rel="" target="">LINUX(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/269821.html" class="category-item-link" rel="" target="">loadrunner(7)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/269819.html" class="category-item-link" rel="" target="">oracle(7)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/133587.html" class="category-item-link" rel="" target="">osworkflow(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/269823.html" class="category-item-link" rel="" target="">spring(15)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/1321063.html" class="category-item-link" rel="" target="">springboot 系列(14)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/category/69600.html" class="category-item-link" rel="" target="">sql server 2005(26)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/category/1199144.html" class="category-item-link" rel="" target="">VUE开发系列(12)</a>

            </li>                <li class="catList">
            <a href="javascript:void(0)" onclick="sideColumnManager.loadMore(this)">更多</a>
        </li>

    </ul>
    <h1 class="catListTitle">
        
随笔档案



    </h1>
    <ul>
            <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2022/03.html" class="category-item-link" rel="" target="">2022年3月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2022/02.html" class="category-item-link" rel="" target="">2022年2月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2022/01.html" class="category-item-link" rel="" target="">2022年1月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2021/12.html" class="category-item-link" rel="" target="">2021年12月(6)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2021/10.html" class="category-item-link" rel="" target="">2021年10月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2021/09.html" class="category-item-link" rel="" target="">2021年9月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2021/06.html" class="category-item-link" rel="" target="">2021年6月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2021/05.html" class="category-item-link" rel="" target="">2021年5月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2021/04.html" class="category-item-link" rel="" target="">2021年4月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2020/06.html" class="category-item-link" rel="" target="">2020年6月(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2020/05.html" class="category-item-link" rel="" target="">2020年5月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2020/04.html" class="category-item-link" rel="" target="">2020年4月(9)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2020/03.html" class="category-item-link" rel="" target="">2020年3月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2020/01.html" class="category-item-link" rel="" target="">2020年1月(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2019/12.html" class="category-item-link" rel="" target="">2019年12月(4)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2019/11.html" class="category-item-link" rel="" target="">2019年11月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2019/10.html" class="category-item-link" rel="" target="">2019年10月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2019/09.html" class="category-item-link" rel="" target="">2019年9月(7)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2019/07.html" class="category-item-link" rel="" target="">2019年7月(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2019/06.html" class="category-item-link" rel="" target="">2019年6月(9)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2019/05.html" class="category-item-link" rel="" target="">2019年5月(16)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2019/04.html" class="category-item-link" rel="" target="">2019年4月(13)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2019/03.html" class="category-item-link" rel="" target="">2019年3月(4)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2019/02.html" class="category-item-link" rel="" target="">2019年2月(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2019/01.html" class="category-item-link" rel="" target="">2019年1月(6)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2018/12.html" class="category-item-link" rel="" target="">2018年12月(17)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2018/11.html" class="category-item-link" rel="" target="">2018年11月(5)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2018/10.html" class="category-item-link" rel="" target="">2018年10月(16)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2018/09.html" class="category-item-link" rel="" target="">2018年9月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2018/08.html" class="category-item-link" rel="" target="">2018年8月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2018/07.html" class="category-item-link" rel="" target="">2018年7月(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2018/06.html" class="category-item-link" rel="" target="">2018年6月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2018/04.html" class="category-item-link" rel="" target="">2018年4月(10)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2016/12.html" class="category-item-link" rel="" target="">2016年12月(4)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2016/11.html" class="category-item-link" rel="" target="">2016年11月(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2016/10.html" class="category-item-link" rel="" target="">2016年10月(10)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2016/09.html" class="category-item-link" rel="" target="">2016年9月(7)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2016/02.html" class="category-item-link" rel="" target="">2016年2月(11)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2015/09.html" class="category-item-link" rel="" target="">2015年9月(5)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2015/08.html" class="category-item-link" rel="" target="">2015年8月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2015/07.html" class="category-item-link" rel="" target="">2015年7月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2015/05.html" class="category-item-link" rel="" target="">2015年5月(6)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2015/03.html" class="category-item-link" rel="" target="">2015年3月(13)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2015/02.html" class="category-item-link" rel="" target="">2015年2月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2015/01.html" class="category-item-link" rel="" target="">2015年1月(12)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2014/11.html" class="category-item-link" rel="" target="">2014年11月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2014/10.html" class="category-item-link" rel="" target="">2014年10月(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2014/07.html" class="category-item-link" rel="" target="">2014年7月(7)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2014/05.html" class="category-item-link" rel="" target="">2014年5月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2014/04.html" class="category-item-link" rel="" target="">2014年4月(7)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2011/08.html" class="category-item-link" rel="" target="">2011年8月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2011/07.html" class="category-item-link" rel="" target="">2011年7月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2011/03.html" class="category-item-link" rel="" target="">2011年3月(5)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2011/02.html" class="category-item-link" rel="" target="">2011年2月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2011/01.html" class="category-item-link" rel="" target="">2011年1月(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2010/12.html" class="category-item-link" rel="" target="">2010年12月(4)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2010/11.html" class="category-item-link" rel="" target="">2010年11月(5)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2010/10.html" class="category-item-link" rel="" target="">2010年10月(5)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2010/09.html" class="category-item-link" rel="" target="">2010年9月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2010/08.html" class="category-item-link" rel="" target="">2010年8月(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2010/07.html" class="category-item-link" rel="" target="">2010年7月(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2010/06.html" class="category-item-link" rel="" target="">2010年6月(4)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2010/05.html" class="category-item-link" rel="" target="">2010年5月(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2010/04.html" class="category-item-link" rel="" target="">2010年4月(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2010/03.html" class="category-item-link" rel="" target="">2010年3月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2010/02.html" class="category-item-link" rel="" target="">2010年2月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2009/12.html" class="category-item-link" rel="" target="">2009年12月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2009/11.html" class="category-item-link" rel="" target="">2009年11月(7)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2009/08.html" class="category-item-link" rel="" target="">2009年8月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2009/06.html" class="category-item-link" rel="" target="">2009年6月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2008/12.html" class="category-item-link" rel="" target="">2008年12月(5)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2008/11.html" class="category-item-link" rel="" target="">2008年11月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2008/10.html" class="category-item-link" rel="" target="">2008年10月(6)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2008/09.html" class="category-item-link" rel="" target="">2008年9月(7)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2008/08.html" class="category-item-link" rel="" target="">2008年8月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2008/07.html" class="category-item-link" rel="" target="">2008年7月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2008/04.html" class="category-item-link" rel="" target="">2008年4月(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2008/03.html" class="category-item-link" rel="" target="">2008年3月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2008/02.html" class="category-item-link" rel="" target="">2008年2月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2008/01.html" class="category-item-link" rel="" target="">2008年1月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2007/12.html" class="category-item-link" rel="" target="">2007年12月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2007/11.html" class="category-item-link" rel="" target="">2007年11月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2007/10.html" class="category-item-link" rel="" target="">2007年10月(2)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2007/08.html" class="category-item-link" rel="" target="">2007年8月(3)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2007/07.html" class="category-item-link" rel="" target="">2007年7月(7)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2007/04.html" class="category-item-link" rel="" target="">2007年4月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2006/12.html" class="category-item-link" rel="" target="">2006年12月(1)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2006/11.html" class="category-item-link" rel="" target="">2006年11月(7)</a>

            </li>                    <li class="catList" data-category-list-item-visible="false" style="display: none">
                
<a href="https://www.cnblogs.com/yg_zhang/archive/2006/09.html" class="category-item-link" rel="" target="">2006年9月(8)</a>

            </li>                <li class="catList">
            <a href="javascript:void(0)" onclick="sideColumnManager.loadMore(this)">更多</a>
        </li>

    </ul>
    <h1 class="catListTitle">
        
文章分类



    </h1>
    <ul>
            <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/category/25683.html" class="category-item-link" rel="" target="">.net 文章(2)</a>

            </li>                

    </ul>
    <h1 class="catListTitle">
        
相册



    </h1>
    <ul>
            <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="https://www.cnblogs.com/yg_zhang/gallery/61736.html" class="category-item-link" rel="nofollow noopener noreferrer" target="">我的BABY(5)</a>

            </li>                

    </ul>
    <h1 class="catListTitle">
        
.net文章



    </h1>
    <ul>
            <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="http://zhidao.baidu.com/question/98090572.html" class="category-item-link" rel="nofollow noopener noreferrer" target="">打印</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="http://www.fengfly.com/plus/view-172481-1.html" class="category-item-link" rel="nofollow noopener noreferrer" target="">仿QQ会员右下角提示框c#实现</a>

            </li>                    <li class="catList" data-category-list-item-visible="true" style="display: block">
                
<a href="http://www.cnblogs.com/idior/articles/100666.html" class="category-item-link" rel="nofollow noopener noreferrer" target="">Delegate比较全面的例子</a>

            </li>                

    </ul>
</div>

<!-- 最新评论 -->
<!-- 阅读排行榜 -->
<div id="sidebar_topviewedposts" class="sidebar-block">
<div id="topview_posts_wrap">
    <h3 class="catListTitle">阅读排行榜</h3>
    <div id="TopViewPostsBlock">
        <ul style="word-break:break-all">
                    <li>
                        <a href="https://www.cnblogs.com/yg_zhang/p/6158612.html">
                            1. vue 中使用 AJAX获取数据的方法(119863)
                        </a>
                    </li>
                    <li>
                        <a href="https://www.cnblogs.com/yg_zhang/p/4314602.html">
                            2. mybatis map foreach遍历(62491)
                        </a>
                    </li>
                    <li>
                        <a href="https://www.cnblogs.com/yg_zhang/p/4331498.html">
                            3. Linux中文显示乱码？如何设置centos显示中文(49242)
                        </a>
                    </li>
                    <li>
                        <a href="https://www.cnblogs.com/yg_zhang/p/4799369.html">
                            4. ANGULAR JS WATCH监听使用(37081)
                        </a>
                    </li>
                    <li>
                        <a href="https://www.cnblogs.com/yg_zhang/p/3662445.html">
                            5. spring 启动完成后事件监听器处理(26541)
                        </a>
                    </li>
        </ul>
    </div>
</div></div>

<!-- 评论排行榜 -->
<div id="sidebar_topcommentedposts" class="sidebar-block"><div id="topfeedback_posts_wrap">
    <h3 class="catListTitle">评论排行榜</h3>
    <div id="TopFeedbackPostsBlock">
        <ul style="word-break:break-all">
                    <li>
                        <a href="https://www.cnblogs.com/yg_zhang/archive/2007/04/24/724827.html">
                            1. SQL 2005 SSIS 导入数据效率问题(18)
                        </a>
                    </li>
                    <li>
                        <a href="https://www.cnblogs.com/yg_zhang/archive/2006/09/20/508961.html">
                            2. asp.net 2.0 使用sqlserver2005 新的通知数据缓存实现(9)
                        </a>
                    </li>
                    <li>
                        <a href="https://www.cnblogs.com/yg_zhang/archive/2006/11/22/568852.html">
                            3. sql 删除重复记录(5)
                        </a>
                    </li>
                    <li>
                        <a href="https://www.cnblogs.com/yg_zhang/archive/2008/07/30/1256850.html">
                            4. ARCGIS JSF AJAX实现返回实时比例尺(4)
                        </a>
                    </li>
                    <li>
                        <a href="https://www.cnblogs.com/yg_zhang/p/4314602.html">
                            5. mybatis map foreach遍历(3)
                        </a>
                    </li>
        </ul>
    </div>
</div></div>

<!-- 推荐排行榜 -->
<div id="sidebar_topdiggedposts" class="sidebar-block">
<div id="topdigg_posts_wrap">
    <div class="catListView">
        <h3 class="catListTitle">推荐排行榜</h3>
        <div id="TopDiggPostsBlock">
            <ul style="word-break: break-all">
                        <li>
                            <a href="https://www.cnblogs.com/yg_zhang/p/4314602.html">
                                1. mybatis map foreach遍历(4)
                            </a>
                        </li>
                        <li>
                            <a href="https://www.cnblogs.com/yg_zhang/p/4799369.html">
                                2. ANGULAR JS WATCH监听使用(3)
                            </a>
                        </li>
                        <li>
                            <a href="https://www.cnblogs.com/yg_zhang/p/4308271.html">
                                3. @ModelAttribute运用详解(3)
                            </a>
                        </li>
                        <li>
                            <a href="https://www.cnblogs.com/yg_zhang/p/10867617.html">
                                4. VUE router-view key 属性解释(2)
                            </a>
                        </li>
                        <li>
                            <a href="https://www.cnblogs.com/yg_zhang/p/10736442.html">
                                5. 使用mybatis plus 操作数据库(2)
                            </a>
                        </li>
            </ul>
        </div>
    </div>
</div></div><div id="sidebar_recentcomments" class="sidebar-block"><div id="recent_comments_wrap" class="RecentComment">
    <h3 class="catListTitle">最新评论</h3>
    <div class="RecentCommentBlock">
        <ul>
                    <li class="recent_comment_title"><a href="https://www.cnblogs.com/yg_zhang/p/15730944.html">1. Re:使用CANAL同步数据</a></li>
                    <li class="recent_comment_body"><p>图片的那个步骤的，箭头是什么化的图，请问  ，嘻嘻 挺好的</p>
</li>
                    <li class="recent_comment_author">--十色</li>
                    <li class="recent_comment_title"><a href="https://www.cnblogs.com/yg_zhang/p/4314602.html">2. Re:mybatis map foreach遍历</a></li>
                    <li class="recent_comment_body">@照旧this.getBySqlKey("getByMap", params); 这些代码可以发我一下吗。。...</li>
                    <li class="recent_comment_author">--泥柿沃德堡贝</li>
                    <li class="recent_comment_title"><a href="https://www.cnblogs.com/yg_zhang/p/4314602.html">3. Re:mybatis map foreach遍历</a></li>
                    <li class="recent_comment_body"><p>this.getBySqlKey("getByMap", params);<br>
这些代码可以补一下吗</p>
</li>
                    <li class="recent_comment_author">--泥柿沃德堡贝</li>
                    <li class="recent_comment_title"><a href="https://www.cnblogs.com/yg_zhang/p/4314602.html">4. Re:mybatis map foreach遍历</a></li>
                    <li class="recent_comment_body"><p>很强！</p>
</li>
                    <li class="recent_comment_author">--照旧</li>
                    <li class="recent_comment_title"><a href="https://www.cnblogs.com/yg_zhang/p/9981569.html">5. Re:FASTDFS 安装与开发</a></li>
                    <li class="recent_comment_body"><p>好文章，感谢分享O(∩_∩)O</p>
</li>
                    <li class="recent_comment_author">--首席抄袭官</li>
        </ul>
    </div>
</div></div>


</div>
                    <script>loadBlogSideColumn();</script>
				</div>
			
		</div>
		<!-- //右侧工具部分 -->
		<div id="footer">
			<!--done-->
Copyright © 2022 自由港
<br><span id="poweredby">Powered by .NET 6 on Kubernetes</span>



		</div>
	</div>
	<!-- right ends -->
	<div class="clear"></div>
	
</div>


    

    <input type="hidden" id="antiforgery_token" value="CfDJ8GsLOKiGtk1Au0UP1SouGdWeecG9Rmb4IHRXJ3DdjtwSX962blyZ2up1Wfr-TqODj_m35Jjso922c0l_MbLvjsGN_CQoOz8P9vhp6UzsKi0aXwqW8JlG6mhUOGkxTbAwq8OX2IyXNo_UmNoO64Uc_FQ">
    <script async="" src="./使用mybatis plus 操作数据库_files/js"></script>
    <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
    var kv = getGACustom();
    if (kv) {
        gtag('set', kv);
    }
    gtag('config', 'UA-476124-1');
    </script>
    <script defer="" src="./使用mybatis plus 操作数据库_files/hm.js.下载"></script><iframe src="./使用mybatis plus 操作数据库_files/container.html" style="visibility: hidden; display: none;"></iframe>

<iframe src="./使用mybatis plus 操作数据库_files/aframe.html" width="0" height="0" style="display: none;"></iframe></body></html>